﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WebApiExtend
{
    /// <summary>
    /// 通用查询参数
    /// </summary>
    public class QueryParameters
    {
        /// <summary>
        /// 查询参数
        /// </summary>
        public List<FilterModel> Filters { get; set; } = new List<FilterModel>() { };

        /// <summary>
        /// 排序 id desc/id asc
        /// </summary>
        public List<string> OrderBy { get; set; } = new List<string>();

        /// <summary>
        /// 页码
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页数量,默认20条
        /// </summary>
        public int PageSize { get; set; } = 20;
    }

    /// <summary>
    /// 通用查询参数
    /// </summary>
    public class FilterModel
    {
        /// <summary>
        /// 字段名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 查询类型<!-- =,!=,>,>=,<,<=,in,not in, like, not like -->
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// 值
        /// </summary>
        public string Value { get; set; }
    }
}
